<!DOCTYPE html>
<html>
<head>
	<title></title>
	<script type="text/javascript" src="js/jquery.js"></script>

</head>
<body>
序号：<input type="text" id="xh"></input><br />
姓名：<input type="text" id="xm"></input><br />
专业：<input type="text" id="zy"></input><br />
年龄：<input type="text" id="nl"></input><br />
<button type="button" id="addnewtr">点击生成新行</button>
<button type="button" id="deltr">批量删除</button>

<table width="200" border="1" cellspacing="0" cellpadding="0" id="datatable">
  <tr>
    <td><input type="checkbox" class="allche"></input></td>
    <td>序号</td>
    <td>姓名</td> 
    <td>专业</td>
    <td>年龄</td>
  </tr>
</table>

<script type="text/javascript">
	$("#addnewtr").click(function(){
    var table = $("#datatable");
    var xuhao = $("#xh").val();
    var xingming = $("#xm").val();
    var zhuanye = $("#zy").val();
    var nianling = $("#nl").val();
    var insert = "<tr><td><input type='checkbox' class='singleChe'></td><td>"+xuhao+"</td><td>" +xingming+ "</td><td>"+zhuanye+"</td><td>"+nianling+"</td></tr>";
    table.append(insert);
  });

  $(".allche").click(function(){
    if($(this).prop("checked")==true){
      $(".singleChe").prop("checked",true);
    }else{
      $(".singleChe").prop("checked",false);
    }
  })

  $("#deltr").click(function(){
    var checkedCols = $(".singleChe:checked");
    checkedCols.each(function(index,elem){
      var $_elem = $(elem); 
      var $_tr = $_elem.parent().parent();
      $_tr.remove();
      
    })
    
  });
</script>
</body>
</html>